clear all;
close all;

method_list = {
  '20% GF';
  '40% GF';
  '60% GF';
  '80% GF';
  'No GF';
  };

seqence_num = {
  '00';
  '02';
  '06';
  '07';
  '08';
  '09';
  };

%% seq 00
rmsErr_list(1,:,:) = [
  15.02	13.95	16.66	13.17	13.3
  14.46	14.73	14.48	18.02	13.75
  12.94	13.94	12.17	16.76	15.9
  15.9	15.93	17.53	15.08	12.85
  18.6	12.98	13.03	13.61	18.3
  17.18	14.13	11.37	13.2	13.3
  16.26	11.55	13.84	14	19.53
  10.29	16.39	13.6	15.06	15.12
  10.61	17.48	15.14	7.96	19.45
  12.55	14.62	14.22	17.66	13.03
  ];

% seq 02
rmsErr_list(2,:,:) = [
  72.966664	73.658367	48.908126	78.15	80.660338
  40.891182	76.079097	59.199639	67.88	57.8409
  71.020981	76.487563	65.398433	49.33	59.925334
  52.487222	76.574466	167.788856	72.02	62.108302
  54.189104	12.869982	61.863046	66.52	61.809675
  70.265599	52.300556	64.7384	62.47	60.820997
  44.732886	89.130416	65.705105	70.39	60.976659
  48.771509	71.789876	63.987354	71.9	70.63438
  62.767218	66.602749	76.368871	64.28	67.279128
  50.314996	71.7908	70.513254	66.58	59.267936
  ];

% seq 06
rmsErr_list(3,:,:) = [
  24.179159	26.724622	26.861448	25.173791	22.808979
  25.995482	25.887791	26.148816	23.809748	24.788964
  24.068062	25.735407	24.655714	27.009623	26.817162
  25.918966	25.390406	26.420566	24.322637	25.629146
  27.018734	25.800947	24.406291	25.635122	24.789034
  26.932147	25.953233	26.900117	25.751808	26.617102
  23.913686	25.366996	25.685956	24.986069	24.409655
  26.201309	24.965134	26.009672	26.110326	25.867366
  26.419234	24.345934	24.094261	25.858769	23.986023
  23.360164	26.182778	26.052184	25.528239	24.995225
  ];

% seq 07
rmsErr_list(4,:,:) = [
  13.407063	15.159792	14.619975	14.642864	14.497263
  14.905769	14.002555	15.005962	14.404613	13.724709
  13.696386	13.215121	15.603173	13.915429	12.75655
  15.452673	14.902393	14.8684	13.246394	12.52534
  14.050406	13.484423	14.630649	13.964667	14.50071
  14.914587	14.33479	15.578183	14.145966	13.146383
  13.202025	13.273865	13.589747	14.8909	13.627161
  13.900978	11.650713	15.064682	13.720077	12.917879
  15.247528	14.35703	15.00288	13.749234	13.173433
  13.240323	13.265867	13.546542	13.360801	12.333658
  ];

% seq 08
rmsErr_list(5,:,:) = [
  39.696312	35.028712	35.890554	38.585685	37.521325
  37.524706	39.115872	43.379424	36.749044	39.498197
  35.400877	39.665655	38.643632	47.203811	37.321723
  40.788267	36.138638	34.593027	32.063509	36.699077
  35.732626	35.463884	37.173681	32.547929	34.630302
  37.511535	36.753782	29.646705	35.42383	40.532117
  41.525395	39.690414	34.942318	31.216939	37.235052
  39.791214	38.670406	36.250044	37.246274	40.573979
  42.906457	39.047388	29.862442	39.525509	34.800867
  44.893261	33.554379	32.263083	34.438238	45.824759
  ];

%% seq 09
rmsErr_list(6,:,:) = [
  47.804748	41.144296	43.898927	44.269642	48.431159
  52.830705	43.914527	50.033403	36.616366	36.017486
  42.793556	40.995778	37.749552	38.632782	49.135717
  44.06948	41.043214	46.317054	36.882197	38.617147
  46.086793	38.464861	45.364135	41.821869	43.068739
  48.067971	36.932591	36.881287	43.421459	49.214345
  49.360942	42.249345	45.577625	44.905865	39.626331
  49.312955	40.024651	51.018002	34.388803	40.845786
  47.982921	52.096244	48.157645	36.124174	48.345138
  38.828324	41.082106	44.903123	39.915383	43.657207
  ];

%% plot
for i=1:length(seqence_num)
  figure
  boxplot(reshape(rmsErr_list(i, :, :), 10, 5), method_list);
  xlabel('methods')
  ylabel('rms error')
  title(['sequence ' seqence_num{i} ' no loop closure'])
  
  saveas(gcf, ['RMS_seq_' seqence_num{i} '_nlp.png'])
end